﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CbHTFkSP_ExtendForm.aspx.vb" Inherits="PubProject.CbHTFkSP_ExtendForm" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o="urn:schemas-microsoft-com:office:office">
	<HEAD>
		<title></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/MyWorkflow/Workflow.js"></script>
		<script language="javascript" src="/MyWorkflow/Blank.js"></script>
		<script language="javascript" src="/PubProject/js/Public.js"></script>		
		<script language="javascript" src="/CBGL/JS/BudgetCostUse.js"></script>
		<script language="javascript" src="/CBGL/JS/StockCostUse.js"></script>
		<script language="javascript" src="/CBGL/JS/Public.js"></script>
		<script language="javascript" src="/Qmys/FKSP/ApplyPublic.js"></script>
		<script language="javascript" src="/CBGL/JS/ContractPub.js"></script>
		<script language="javascript" src="/Qmys/JS/Public.js"></script>
		<style> 
		    body{font-size:9pt;}
	        table{font-size:9pt;}
	        P{font-size:9pt;}
		    .style1
            {
                height: 159px;
            }
		</style>
		<LINK href="/MyWorkflow/css/form.css" type="text/css" rel="stylesheet">
		<script language="javascript">
		    var ObjBudgetCostUse = null;//选择合约规划类
			var ObjStockCostUse = null; //选择公司库存类
			var sProjType = "",sHTFKApplyGUID;          //合同类型、付款申请GUID
			var sMonthContractRemainAmount = "0.0"; //月度资金计划，当月本合同可用金额
			var IsLicenseQmys = IsLicenseApp("费用预算");   //是否启用了全面预算
			var sContractGUID = "";
			 
			/*------------------------------------------------------------------*/
			//表单接口函数，需扩展
			//1、Fill	--	表单填充
			//2、GetXML --	表单取数
			//3、Valid	--	表单校验
			/*------------------------------------------------------------------*/
			//屏避右键
			function document.oncontextmenu()
			{
				var s = event.srcElement.tagName;
				// For Selection Ranges, s will be UNDEFINED
				if (s && s != "INPUT" && s != "TEXTAREA" || event.srcElement.disabled || document.selection.createRange().text.length == 0)
				{
					event.returnValue = false;
				}
			}
			//功能：表单填充
			//editableDomainList	当前步骤可编辑域
			//invisibleDomainList   当前步骤不可见域
			//domainXML				域XML
			function Fill(editableDomainList,invisibleDomainList,domainXML)
			{
				var xmlDom = new ActiveXObject("Microsoft.XMLDOM"); 
				if (domainXML && domainXML.length>0)	
				{		
					xmlDom.async=false; 
					xmlDom.loadXML(domainXML);
					
					if(xmlDom.parseError.errorCode != 0) 
						xmlDom = null; 
				}
				else
				{
					xmlDom = null;
				}

				Form1.ProjectNameList.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='付款项目期别']").text;
				var sLaunchDate = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='填报日期']").text;
				if(sLaunchDate == "")
				{
				    Form1.LaunchDate.value = document.all("txtToday").value;
				}
				else
				{
				    Form1.LaunchDate.value = sLaunchDate;
				}
                
				Form1.ContractCode.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同编号']").text;
				Form1.ContractName.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同名称']").text;				
				Form1.YfProviderName.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='签约单位全称']").text;				
				Form1.BankName.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='开户银行']").text;
				Form1.BankAccounts.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='账号']").text;
				Form1.ReceiveProviderName.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='收款单位全称']").text;
				Form1.HtAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同签约总价']").text;
				Form1.HtDtAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='调整后合同总价']").text;
				Form1.SumPaidAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='累计已付金额']").text ;
				Form1.SumRemainAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='累计未付金额']").text;	
				Form1.ApplyAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次申请金额']").text;
				Form1.YfAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次应付金额']").text;
				Form1.UpperYfAmount_Bz.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次应付金额（大写）']").text;
				Form1.ApplyType.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='申请类型']").text;
				
				Form1.TxtAArticle.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次付款合同条款概要']").text;
				Form1.TxtAPerform.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同履行情况']").text;
				Form1.TxtAAccountGC.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='付款金额简要计算过程']").text;		
				Form1.TxtAJbrMind.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='经办人意见']").text;
				Form1.TxtARemark.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='备注']").text;
				
				Form1.UseCostInfo.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合约规划']").text;	
				Form1.UseStockInfo.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='中间科目']").text;	
				
				//读取月度资金计划，当月本合同可用金额
				Form1.MonthContractRemainAmount.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='当月本合同可用金额']").text;
				sMonthContractRemainAmount = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='当月本合同可用金额']").text.replace(/,/g,"");	
				
				var objlist = getHTMLDomainField(document);
				
				for(var i=0;i<objlist.length;i++)
				{ 	
					if((invisibleDomainList+",").indexOf(objlist[i].dm_name + ',')>-1)
					{
						//不可见域不显示
						objlist[i].style.display="none";
					}
				
					//不可编辑的disabled,可编辑的enabled
					if((editableDomainList+",").indexOf(objlist[i].dm_name + ',')>-1)
					{
						objlist[i].readOnly =false;
					}
					else
					{
						objlist[i].readOnly =true;
					}
				} 				
								
				sHTFKApplyGUID = xmlDom.selectSingleNode("/BusinessType").attributes.getNamedItem("BusinessGUID").value;
				
				if (sHTFKApplyGUID != "")
				{
				    //相关附件
					document.all["appIfraFJ"].src = "/PubProject/Pub/DocumentUpFile.aspx?FKGUID=" + escape(sHTFKApplyGUID) + "&UpFileState=EDIT&IsAllowOpenFile=true&Title=" + escape("付款申请附件") + "&DocType=" + escape("合同付款申请");				
				    
				    var sFile = "/Cbgl/HTFK/HTFK_XMLHTTP.aspx?HTFKApplyGUID=" + escape(sHTFKApplyGUID);

				    var sRtn = openXMLHTTP(sFile,"GetHTRefApplyMsg");

                    if ("FAIL" != sRtn)
                    {                 
                        //返回  ContractGUID|strProjType
                        var sRtnList = sRtn.split("|");
                        sContractGUID = sRtnList[0];
                        sProjType = sRtnList[1];  
                        
                        if(sProjType != "公司库存")
                        {
                            var trObj = document.getElementById("trByCompanyStock");
                            trObj.style.display = "none";
                            
                            var tabObj = document.getElementById("tabFksp");
                            tabObj.style.borderCollapse="separate";
                            
                        }
                        else
                        {
                            var sRefGUID = sHTFKApplyGUID;
                            var sRefType = "付款申请";
                            var sCfSource = "合同";
                            var sCfTypeName = "签约金额";  
            				    
			                ObjBudgetCostUse = new BudgetCostUse(sContractGUID,sRefGUID,sRefType,sCfSource,sCfTypeName,"付款申请");
                            ObjStockCostUse = new StockCostUse(sContractGUID,sRefGUID,sRefType);   
                        }   
                        
                        //加入无项目的处理
                        if(sProjType == "无项目"){
                           document.all("ifrmCostInfo").src = "/PubProject/workflow/cbgl/CbHTFkSP_ExtendForm_CostTable.aspx?BusinessGUID=" + sHTFKApplyGUID;
                           if(IsLicenseQmys == 0) document.all("trCostInfo").style.height = "0";

                        }else{
                            document.all("trCostInfo").style.display = "none";                            
                        }                        
                    }                    
                }
                
                //没有启用成本则隐藏合约规划
	            if(Form1.txtLicenseCbgl.value=="0"){
	                document.all("trByCompanyStock").style.display="none";
	            }

				
                //获取查看预算详细信息的权限	
                //有权限的条件是：当前节点处理类型=“审批”  and  (当前节点的状态=“在办” or当前节点的状态=“待办”)        说明：代码里写时，“审批”、“在办”、“待办”分别对应的是1、2、1。
				//取当前节点的处理类型；
		        var sHandleType = xmlDom.documentElement.getAttribute("HandleType");
		        //取当前节点的状态；
		        var sNodeStatus = xmlDom.documentElement.getAttribute("NodeStatus");
		        
                if(sHandleType =="[审批]" && (sNodeStatus =="2" || sNodeStatus =="1"))
				{
				    document.all("txtIsCanOpenCostInfo").value = "1";
				}
				else
				{
				    document.all("txtIsCanOpenCostInfo").value = "0";
				}
			}
			
			//功能：表单取数
			//参数：取值前的domainxml
			//返回值 取值后的domainxml
			function GetXML(domainXML)
			{
				var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
				 
				xmlDom.async=false;
				xmlDom.loadXML(domainXML);
						
				if(xmlDom.parseError.errorCode != 0) return "";
				 
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='付款项目期别']").text = Form1.ProjectNameList.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='填报日期']").text = Form1.LaunchDate.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同编号']").text = Form1.ContractCode.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同名称']").text = Form1.ContractName.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='签约单位全称']").text = Form1.YfProviderName.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='开户银行']").text = Form1.BankName.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='账号']").text = Form1.BankAccounts.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='收款单位全称']").text = Form1.ReceiveProviderName.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同签约总价']").text = Form1.HtAmount_Bz.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='调整后合同总价']").text = Form1.HtDtAmount_Bz.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='累计已付金额']").text = Form1.SumPaidAmount_Bz.value ;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='累计未付金额']").text = Form1.SumRemainAmount_Bz.value;	
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次申请金额']").text = Form1.ApplyAmount_Bz.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次应付金额']").text = Form1.YfAmount_Bz.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次应付金额（大写）']").text = Form1.UpperYfAmount_Bz.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='申请类型']").text = Form1.ApplyType.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='本次付款合同条款概要']").text = Form1.TxtAArticle.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='合同履行情况']").text = Form1.TxtAPerform.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='付款金额简要计算过程']").text = Form1.TxtAAccountGC.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='经办人意见']").text = Form1.TxtAJbrMind.value;		
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='备注']").text = Form1.TxtARemark.value;
				
				return xmlDom.xml;	
			}
			
			//功能：表单校验
			//参数：可编辑域列表
			function Valid(editableDomainList)
			{
				return true;
			}
			
			//功能：发起审批时校验			
			function InitValidate()
			{				
				//公司库存的付款申请才需要				
				if(sProjType == "公司库存")
				{
				    if(CheckCostQK(sContractGUID,sHTFKApplyGUID,"发起审批") == false) 
                    {
                       return false;
                    }
                    
				    var sFile = "/Cbgl/HTFK/HTFK_XMLHTTP.aspx?HTFKApplyGUID=" + escape(sHTFKApplyGUID);
				    var sRtn = openXMLHTTP(sFile,"CheckProjectBudget");
				    if(sRtn != "OK"){
				        alert(sRtn.split("|")[1]);
				        return false;
				    }
                 }
                 
                 if(!CheckHTFKApplyIfAmountEqual(ObjBudgetCostUse,ObjStockCostUse,sProjType,sContractGUID,sHTFKApplyGUID,stringToFloat(Form1.ApplyAmount_Bz.value),false)) return false;
                 
                 //校验当前工作流程与付款申请对应付款申请类型的工作流审批流程是否一至
                 sFile = "/Cbgl/HTFK/HTFK_XMLHTTP.aspx?HTFKApplyGUID=" + escape(sHTFKApplyGUID);
                 sRtn = openXMLHTTP(sFile,"getProcessGUID");
                 var sUrl=window.parent.location.search;
                 var sprocessGUID=sUrl.substr(sUrl.indexOf("processguid")+12,36);
                 if(sprocessGUID.toLowerCase()!=sRtn.toLowerCase()){
                    if (window.parent.appForm.ProcessModuleGUID.value.toLowerCase() != sRtn.toLowerCase()) //保存草稿时，要取父页面的appForm
                    {
                        alert("付款单据对应的流程模板不一致，不允许发起审批！");
                        return false;
                    }
                 }
                
                 //校验当前模板的月度资金计划，当月本合同可用金额是否与数据库里面的金额一至，不一至不允许发起                 
                 sFile = "/Cbgl/HTFK/HTFK_XMLHTTP.aspx?HTFKApplyGUID=" + escape(sHTFKApplyGUID)+"&MonthContractRemainAmount=" + sMonthContractRemainAmount;
                 sRtn = openXMLHTTP(sFile,"ValideMonthContractRemainAmount");
                 if("OK" != sRtn)
                 {
                    alert("当前表单的当月本合同可用金额与月度资金计划对应的金额不一致，不允许发起审批！\n请重新保存付款申请，并同步表单数据。");
                    return false;
                 }
				return true;
			}
			
			//提交审批前判断科目成本强控
            function CheckCostQK(sContractGUID,sHTFKApplyGUID,sInfo)
            {    	  
	           //读取付款申请对应的合约规划使用信息
	            var sRefGUID = sHTFKApplyGUID;
                var sRefType = "付款申请";
                var sCfSource = "合同";
                var sCfTypeName = "签约金额"; 
                
                if (sContractGUID == undefined || sContractGUID == "") 
                {
                    alert("未读取到合同信息，请重试！");
                    return false;
                }
				    
                ObjBudgetCostUse = new BudgetCostUse(sContractGUID,sRefGUID,sRefType,sCfSource,sCfTypeName,"付款申请");
                ObjStockCostUse = new StockCostUse(sContractGUID,sRefGUID,sRefType); 
                
	            //校验选择的合约规划是否有效
                var sReturn = VerifyBudget(ObjBudgetCostUse);
                if(sReturn != "")
                {
                    //重新刷新合约规划使用
                    ObjBudgetCostUse = BudgetCostUseReload(ObjBudgetCostUse);
                    //有无效合约规划使用
                    // ChgUseCost(sReturn);
                    return false;
                 }
            	        
            	
	            var strBudgetList=GetYjBudgetList(ObjBudgetCostUse.GetDataXml());//格式为合约规划GUID1;合约规划GUID2|对应金额1;对应金额2........  
            	
                //判断强控
                if(!CheckCostCompel(strBudgetList,"付款申请",sHTFKApplyGUID,sInfo))
                {
                    return false;
                }
                else
                {
                    return true;
                }    
            }
			
			
    function ChgUseCost()
    {
        //aobo add on 20081028 选择合约规划
	    if (null==ObjBudgetCostUse)
	    {	     
	        return; 	
	    }
    	
	    if (document.readyState != "complete")
	    {
		    alert("当前页面没有加载完，请稍候保存！");
		    event.returnValue = false;
	        return;
	    }		
    	
	    var mode = "3";

        var kFtAmount = stringToFloat(Form1.ApplyAmount_Bz.value) - stringToFloat(ObjStockCostUse.GetYCfAmount());

        if(ObjBudgetCostUse.UpdateData(kFtAmount,mode,'0','0','0'))
        {
            //alert(ObjBudgetCostUse.GetYCfAmount());
        }
    }


    function SelectCompStock()
	{
	    //aobo add 20081028 增加选择公司库存
	    // aobo add on 20081028
		if (document.readyState != "complete")
		{
			alert("当前页面没有加载完，请稍候保存！");
			event.returnValue = false;
		    return;
		}	
		
		//aobo add on 20081028 选择司库存
	    if (null==ObjStockCostUse) return; 
		
		var mode =  "3";
	   		
		//选择公司库存界面
		//分摊金额，新增时，需要将合同金额减去选择合约规划金额
		var kFtAmount = stringToFloat(Form1.ApplyAmount_Bz.value) - stringToFloat(ObjBudgetCostUse.GetYCfAmount());
		if(ObjStockCostUse.UpdateData(kFtAmount,mode))
	    {
	    
	    }		  	
	}
	
    function openViewLayer(vBudgetList)
     {
      
        if (vBudgetList.value ==undefined  || vBudgetList.value=="")  return false;

        var xmlBudget;
        var i;
        var sBudgetGUID;
    	
        sBudgetGUID="";

        xmlBudget = ObjBudgetCostUse.DataXml;
        iRow =xmlBudget.getElementsByTagName("cb_BudgetUse/DataList/Row").length;
        for(i=0;i<iRow;i++)
        {
	        node = xmlBudget.getElementsByTagName("cb_BudgetUse/DataList/Row")(i);		
    		
	        sBudgetGUID=sBudgetGUID + ""+node.attributes.getNamedItem("BudgetGUID").text+",";
        }	
        if(sBudgetGUID!="")
        {
          sBudgetGUID = sBudgetGUID.substring(0,sBudgetGUID.lastIndexOf(","))
          document.all("appDemoIframe").src = "/Cbgl/PUB/SelectBudgetPath.aspx?mode=3&BudgetGUID="+sBudgetGUID
          ShowViewLayer(true);
        }
        else
        {
           return false; 
        }
        
     }
	

// function openViewLayer(vBudgetList)
// {

//    if (vBudgetList.value ==undefined  || vBudgetList.value=="")  return false;

//	var xmlBudget;
//	var i;
//	var sBudgetGUID;
//	
//	sBudgetGUID="";

//	xmlBudget = ObjBudgetCostUse.DataXml;
//	iRow =xmlBudget.getElementsByTagName("cb_BudgetUse/DataList/Row").length;
//	for(i=0;i<iRow;i++)
//	{
//		node = xmlBudget.getElementsByTagName("cb_BudgetUse/DataList/Row")(i);
//		
//		sBudgetGUID=sBudgetGUID + ""+node.attributes.getNamedItem("BudgetGUID").text+",";
//	}	
//	if(sBudgetGUID!="")
//	{
//	  sBudgetGUID = sBudgetGUID.substring(0,sBudgetGUID.lastIndexOf(","))
//	  createBg(); 
//      createCon(sBudgetGUID); 
//	}
//	else
//	{
//	   return false; 
//	}
//    
// }
 
function createBg()//创建背景 
{ 
    var bgDiv=document.createElement("div"); 
    bgDiv.id="bgDiv"; 
	bgDiv.style.cssText="background-color:black;position:absolute;left:0px;top:0px;height:100%;width:100%;filter:Alpha(Opacity=\"0\");"; 
	bgDiv.innerHTML=""+" <table> <tr> <td> </td> </tr> </table>"; 
	var bgBody=document.getElementById("bodyId");//主页面BODY的ID 
	bgBody.appendChild(bgDiv); 
} 

function createCon(sBudgetGUID)//创建背景的关闭按钮 
{ 
	var conDiv=document.createElement("div"); 
	var bgBody=document.getElementById("bodyId");//主页面BODY的ID 
	conDiv.innerHTML= ""+" <table> <tr> <td> <iframe id='appIframe' src='/Cbgl/PUB/SelectBudgetPath.aspx?mode=3&BudgetGUID="+sBudgetGUID+"' frameborder=\"no\" height=\"300\" width=\"400\" scrolling=\"auto\"></iframe> </td> </tr> </table>"; 
	if((document.getElementById("bodyId").clientTop+document.getElementById("bodyId").clientHeight) - event.clientY > 300 )
	{
	   conDiv.style.cssText="position:absolute;left:"+event.clientX+";top:"+event.clientY+";height:300px;width:400px;"; 
	}
	else
	{
	   conDiv.style.cssText="position:absolute;left:"+event.clientX+";top:"+event.clientY-300+";height:300px;width:400px;"; 
	}
	
	bgBody.appendChild(conDiv); 
} 

function closeDemo()//关闭 
{ 
	var bgBody=document.getElementById("bodyId"); 
	bgBody.removeChild(bgBody.lastChild); 
	bgBody.removeChild(bgBody.lastChild); 
} 
					
			
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout" id="bodyId" style="overflow:auto;">
	
	  <div id="bgDiv" style="display:none;background-color:white;position:absolute;left:0px;top:0px;height:300px;width:400px;" onmouseout="ShowDeptUseViewLayer(false)">
			<table> <tr> <td> <table> <tr> <td> <iframe id='appDemoIframe' src='' frameborder='no' height='300' width='400' scrolling='auto'></iframe> </td> </tr> </table> </td> </tr> </table>
      </div>
	
		<form id="Form1" method="post" runat="server">
		    <asp:textbox id="txtToday" Runat="server" style="DISPLAY:none"></asp:textbox>
			<asp:textbox id="ApplyUserGUID" runat="server" style="display:none"></asp:textbox>
			<asp:textbox id="ApplyDeptGUID" runat="server" style="display:none"></asp:textbox>
			<asp:textbox id="ResultTypeGUID" runat="server" style="display:none"></asp:textbox>
			<asp:textbox id="WorkResultGUID" runat="server" style="display:none"></asp:textbox>	
			<asp:textbox id="txtLicenseCbgl" style="DISPLAY: none" Runat="server"></asp:textbox>
			<input type="text" style="display:none" id="txtIsCanOpenCostInfo" value="1" />
			<TABLE width="100%">
				<TBODY>
					<TR>
						<TD><!-- 表单 -->
							<P align="center" id="pTitle"><FONT style="FONT-SIZE: 16px"><STRONG>付款申请审批表</STRONG></FONT></P>
							<P align="center">
								<TABLE id="tabFksp" style="TABLE-LAYOUT: fixed; WIDTH: 90%; BORDER-COLLAPSE: collapse" borderColor="#517dbf"
									cellSpacing="2" cellPadding="3" align="center" bgColor="#ffffff" border="1">
									<colgroup>
										<col width="100"/>
										<col/>
										<col width="100"/>
										<col/>										
									</colgroup>
									<TR>
										<TD>
											付款项目期别：
										</TD>
										<TD>
											<INPUT class="txt" id="ProjectNameList" style="WIDTH: 100%; HEIGHT: 100%" maxLength="4000"
												dm_name="付款项目期别">
										</TD>
										<TD>
											填报日期：
										</TD>
										<TD >
											<INPUT class="txt" id="LaunchDate" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="填报日期"> 
										</TD>
									</TR>
									<TR>
										<TD>
											合同编号
										</TD>
										<TD>
											<INPUT class="txt" id="ContractCode" style="WIDTH: 100%; HEIGHT: 100%" maxLength="4000"
												dm_name="合同编号">
										</TD>
										<TD>
											合同名称
										</TD>
										<TD >
											<INPUT class="txt" id="ContractName" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="合同名称"> 
										</TD>
									</TR>
									<TR height="25">
										<TD>
											签约单位全称
										</TD>
										<TD>
											<INPUT class="txt" id="YfProviderName" style="WIDTH: 100%; HEIGHT: 100%" maxLength="4000"
												dm_name="签约单位全称">
										</TD>
										<TD>
											开户银行</TD>
										<TD >
											<INPUT class="txt" id="BankName" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="开户银行"> 
										</TD>
									</TR>
									
									<TR height="25">
										<TD>
											收款单位全称
										</TD>
										<TD>
											<INPUT class="txt" id="ReceiveProviderName" style="WIDTH: 100%; HEIGHT: 100%" maxLength="4000"
												dm_name="收款单位全称">
										</TD>
										<TD>
											账号
										</TD>
										<TD >
											<INPUT class="txt" id="BankAccounts" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="账号"> 
										</TD>
									</TR>
									
									<TR height="25">
										<TD>
											合同签约总价
										</TD>
										<TD>
											<INPUT class="num" id="HtAmount_Bz" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="合同签约总价" acc="2">
										</TD>
										<TD>
											调整后合同总价
										</TD>
										<TD >
											<INPUT class="num" id="HtDtAmount_Bz" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="调整后合同总价" acc="2"> 
										</TD>
									</TR>
									
									<TR height="25">
										<TD>
											累计已付金额
										</TD>
										<TD>
											<INPUT class="num" id="SumPaidAmount_Bz" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="累计已付金额" acc="2">
										</TD>
										<TD>
											累计未付金额
										</TD>
										<TD >
											<INPUT class="num" id="SumRemainAmount_Bz" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="累计未付金额" acc="2"> 
										</TD>
									</TR>
									
									<TR height="25">
										<TD>
											本次申请金额
										</TD>
										<TD>
											<INPUT class="num" id="ApplyAmount_Bz" style="WIDTH: 100%; HEIGHT: 100%" maxLength="4000" dm_name="本次申请金额" acc="2">
										</TD>
										<TD>
											本次应付金额
										</TD>
										<TD >
											<INPUT class="num" id="YfAmount_Bz" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="本次应付金额" acc="2"> 
										</TD>
									</TR>
									
									<TR height="30">
										<TD>
											本次应付金额（大写）
										</TD>
										<TD colspan=3>
											<INPUT class="txt" id="UpperYfAmount_Bz" style="WIDTH: 80%; HEIGHT: 100%" maxLength="4000"
												dm_name="本次应付金额（大写）">
										</TD>
										
									</TR>
									
									<TR height="30">
										<TD>
											申请类型
										</TD>
										<TD>
											<INPUT class="txt" id="ApplyType" style="WIDTH: 80%; HEIGHT: 100%" maxLength="100"
												dm_name="申请类型">
										</TD>
										<TD>
											当月本合同可用金额
										</TD>
										<TD >
											<INPUT class="num" id="MonthContractRemainAmount" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="当月本合同可用金额" acc="2"> 
										</TD>
										
									</TR>
														
									<TR id="trByCompanyStock" style="height:70px;">										
										<TD colspan=4>
											<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT:fixed">
                                                <col width=70/><col width=50 /><col /><col width="25" align="right"/><col width=70/>
                                                <tr>
                                                    <td align=right></td> 
                                                    <td>合约规划</td>
                                                    <td><input type="text" class="txt" readOnly ro="0" name="UseCostInfo" value="" maxlength="2000" onmousemove="openViewLayer(this)"></td>
                                                    <td align="right"><img style="cursor:hand" src="/_imgs/btn_off_lookup.gif" onclick="ChgUseCost()"></td>
                                                    <td></td>
                                                </tr>
                                                <tr height="5"><td align=right colspan=5></td> </tr>
                                            </table>
                                            <table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT:fixed">
                                                <col width=70/><col width=50 /><col /><col width="25" align="right"/><col width=70/>
                                                <tr>
                                                    <td align=right></td> 
                                                    <td>中间科目</td>
                                                    <td><input type="text" class="txt" readOnly ro="0" name="UseStockInfo" value="" maxlength="2000" ></td>
                                                    <td align="right"><img style="cursor:hand" src="/_imgs/btn_off_lookup.gif" onclick="SelectCompStock()"></td>
                                                    <td></td>
                                                </tr>
                                            </table>
										</TD>
										
									</TR>
									<TR style="height:120px;" id="trCostInfo">
										<TD colspan=4>
											<iframe id="ifrmCostInfo" frameborder="no" height="100%" width="100%" scrolling="no"></iframe>
										</TD>
										
									</TR>
									<tr height="200px;">
									    <td style="height:200px;" colspan="4">
			                                <table style=" width:100%; height:100%" borderColor="#517dbf" border="1">
			                                    <tr>
			                                        <td rowspan="3"  class="txt" style="width:20px">付款理由</td><td style="width:130px; height:30px">本次付款合同条款概要</td>
			                                        <td>
											            <textarea  style="WIDTH: 100%; HEIGHT:50px" id="TxtAArticle" cols="140" rows="10"  dm_name="本次付款合同条款概要"></textarea>
											        </td>
			                                    </tr>
			                                    <tr>
			                                        <td style="width:130px; height:30px">合同履行情况（进度、质量、配合等）</td>
			                                        <td>
			                                             <textarea  style="WIDTH: 100%; HEIGHT:50px" id="TxtAPerform" cols="140" rows="10"  dm_name="合同履行情况"></textarea>
			                                        </td>
			                                    </tr>
		                                        <tr>
			                                        <td style="width:130px; height:30px">付款金额简要计算过程</td>
			                                        <td>
			                                             <textarea  style="WIDTH: 100%; HEIGHT:50px" id="TxtAAccountGC" cols="140" rows="10"  dm_name="付款金额简要计算过程"></textarea>
			                                        </td>
			                                    </tr>

			                                </table>
									    </td>
									</tr>
								    <TR height="70">
										<TD style="width:60px;" align=center>
											经办人意见
										</TD>
										<TD colspan="3">
                                            <textarea  style="WIDTH: 100%; HEIGHT:60px" id="TxtAJbrMind" cols="140" rows="10"  dm_name="经办人意见"></textarea>
										</TD>										
									</TR>
									<TR height="100">
										<TD style="width:60px;" align=center>
											备注：
										</TD>
										<TD colspan="3">
                                            <textarea  style="WIDTH: 100%; HEIGHT:80px" id="TxtARemark" cols="140" rows="10"  dm_name="备注"></textarea>
										</TD>										
									</TR>
																		
									<TR>
										<TD COLSPAN="4">
											<table width="100%" cellspacing="0" cellpadding="3" style="table-layout:fixed;">
												<TR>
													<TD class='sec bar'>
														相关附件
													</TD>
												</TR>
												<TR height="50">
													<TD>
														<iframe id="appIfraFJ" src="" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
													</TD>
												</TR>
											</table>
										</TD>
									</TR>
								</TABLE>
							</P>
						</TD>
					</TR>					
				</TBODY>
			</TABLE>
		</form>
	</body>
</HTML>